<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Jugar Black Jack</title>
<style>
body {
	background: url("http://p1.pichost.me/i/23/1464286.jpg") no-repeat;
	background-size: cover;
}

table {
background:
		url("http://thumbs.dreamstime.com/x/fondo-del-acero-inoxidable-7240118.jpg")
		no-repeat;
	background-size: cover;
	border: 4px solid #8A0808;
	border-radius: 10px;
	margin: 0 auto;
	text-align: left;
}
h1 {
	text-align: center;
}
#img{
text-align: center;
}
</style>
<%
int CartasJug = (int) (Math.random() * 30) + 1; 
int CartasCas = (int) (Math.random() * 30) + 1; 
boolean win=true;
boolean empate=false;
%>
</head>
<body>
<h1>
			<font color="#CECEF6">Resultados</font>
		</h1>
<table>

		<tr>
			<td>Jugador <%out.print(CartasJug);%></td>
		</tr>
		<tr>
			<td>Casino <%out.print(CartasCas);%></td>
		</tr>
		<tr>
		<td><h3><%
		if(CartasJug>21||CartasJug < CartasCas && CartasCas<=21){
			win=false;
		}

		if(CartasCas>21&&CartasJug>21||CartasCas==CartasJug){
			empate=true;
		}
		if(empate){
			out.println("Empate");
		}else if(win){
		out.println("Jugador gana");
		}else{
			out.println("Casino gana");	
		}
		%></h3></td>
</tr>
<tr>
<td><a href="juego.jsp"><input type="button" value="Volver a Jugar"></a></td>
</tr>
</table>
<div id="img">
<%
if(empate){
	%>
	<img src="http://images.sodahead.com/polls/003843337/240424075_meh_answer_3_xlarge.png">
	<%
}else if(win){
	%>
	<img src="http://api.ning.com/files/C9H-LgPRI-N9eG7z3*SBIL6nS6N4ZYM-35ECdgUoiUF2QI7JbDVZQcenKk3BSkualHjzmYHn0yO6PGrO*OkkLu85T16AKYIB/AAlegraFelicidadCara.png">
	<%
}else{
	%>
	<img src="http://2.bp.blogspot.com/_00OCDZ6jUus/SvDZQXNqBgI/AAAAAAAAAHg/h9VYuX-jE5E/s320/triste.gif">
	<%	
}
%>
</div>
<a href="inicio.jsp"><input type="button" value="Volver a Menu"></a>
</body>
</html>